package com.dragon8869.myspringboot.quartz;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Configuration
@Slf4j
@EnableScheduling
public class Slf4jQuartz {

    @Scheduled(fixedRate = 5000)
    public void trace() {
        log.trace("Slf4jQuartz.trace, " + System.currentTimeMillis());
    }

    @Scheduled(fixedRate = 5000)
    public void debug() {
        log.debug("Slf4jQuartz.debug, " + System.currentTimeMillis());
    }

    @Scheduled(fixedRate = 5000)
    public void info() {
        log.info("Slf4jQuartz.info, " + System.currentTimeMillis());
    }

    @Scheduled(fixedRate = 5000)
    public void warn() {
        log.warn("Slf4jQuartz.warn, " + System.currentTimeMillis());
    }

    @Scheduled(fixedRate = 5000)
    public void error() {
        log.error("Slf4jQuartz.error, " + System.currentTimeMillis());
    }

    /*@Scheduled(fixedRate = 5000)
    public void fatal() {
        log.fatal("LogbackQuartz.fatal, " + System.currentTimeMillis());
    }*/
}
